/**
 * Application Application.java
 */

package CCT220_Aula21_Exercicio01_13106;


import java.awt.BorderLayout;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.JTextField;


/**
 * <div style="border-style:double;">
 * Project: CCT220
 * </br>Package: CCT220_Aula21_Exercicio01_13106
 * </br>Class: Application
 * </br>Created by marcel
 * </br>Description:
 * </div>
 * 
 * @author marcel
 * @author 13106
 * 
 */
public class Application extends JFrame {
	private final String      BUTTON_PANEL = "JPanel with JButtons";
	private final String      TEXT_PANEL   = "JPanel with JTextField";

	private final JTabbedPane tabs;


	public Application() {

		// Cria o primeiro painel com três botõesI
		JPanel p1 = new JPanel();
		p1.add(new JButton("Button 1"));
		p1.add(new JButton("Button 2"));
		p1.add(new JButton("Button 3"));

		// Cria o segundo painel com o campo de texto
		JPanel p2 = new JPanel();
		p2.add(new JTextField("TextField", 20));

		// Inicializa o container e seta o layout
		tabs = new JTabbedPane();
		// Adiciona os painéis e associa um nome (string) a eles
		tabs.add(p1, BUTTON_PANEL);
		tabs.add(p2, TEXT_PANEL);
		// Adiciona o painel de seleção e o painel com os cartões
		setLayout(new BorderLayout());
		add(tabs, BorderLayout.CENTER);
		setSize(300, 200);
		setDefaultCloseOperation(EXIT_ON_CLOSE);
		setVisible(true);
	}


	public static void main(String[] args) {

		new Application();
	}

}
